import { createApp } from 'vue'
import router from './router'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

createApp(App).use(router).use(ElementPlus).mount('#app')


import axios from 'axios'

// 请求拦截器
axios.interceptors.request.use(
    (config: any) => {
        var token = localStorage.getItem('token');
        if(token){
            config.headers.common['Authorization'] = "JWT  " + token;
        }
        return config

    },
    error => {
      return Promise.reject(error);
    } 
);
